/******************************************************************************************************
Copyright (C) 2010 Mestrelab Research S.L. All rights reserved.

This file is part of the MNova scripting toolkit.

Authorized users of MNova Software may use this file freely, but this file is provided AS IS
with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE.
*****************************************************************************************************/

/*globals MultipletReporter, Env*/
/*jslint plusplus: true, indent: 4*/

// This function defines JACS-like multiplet report.
// To customize report, edit this class or implement another one.
function JACSMultipletReporter() {
	"use strict";

	MultipletReporter.call(this);

	this.name = "J. Am. Chem. Soc.";
	this.alias = [this.name, "JACS"];

	this.onlyElementName = false;
	// Define font size and font family
	this.font = "<font style=\"font-size: %1pt; font-family: %2; font-style: %3; font-weight: %4; text-decoration: %5; color: %6\">";

	this.nucleusTemplate = "%1";
	// Report header. %1 will be raplaced with nucleusString, %2  with frequency, %3 with solvent
	this.header = "%1 NMR (%2 MHz, %3) &delta; ";

	// Multiplet templates. %1 - delta, %2 - category, %3 - nH
	this.reportRange = true; // set to true to get multiplet range instead of delta.
	this.withoutJsTemplate = " %1 (%2, %3%NUCLEUS%)"; // multiplet template without J's
	this.withJsTemplate = " %1 (%2, %4 Hz, %3%NUCLEUS%)"; //  multiplet template with J's
	this.rangeTemplate = "%1 &ndash; %2";

	// J's list template. %1 - list of J's
	this.jListTemplate = "<i>J</i> = %1";

	// Assignments template. %1 - atom number
	this.assignmentsTemplate = "%1";

	this.jPrecision = 1; // J's precision
	this.deltaPrecision = 2; // delta precision
	this.mSeparator = ", "; // multiplet separator
	this.jSeparator = ", "; // J's separator

	this.start = this.font;
	this.end = ".</font>";
}

JACSMultipletReporter.prototype = new MultipletReporter();
JACSMultipletReporter.prototype.toString = function () {
	"use strict";
	return "JACSMultipletReporter()";
};
if (Env.MultipletReportersArray) {
	Env.MultipletReportersArray.push(new JACSMultipletReporter());
}
